<?php namespace App\Admin\Experience\Enter\Listeners;

use App\Core\Exceptions\InputError;
use App\Core\Service\Listeners\CreateListener as Base;
use Input;
use DB;

class CreateListener extends Base {
    
    public function onCreateSaved(){
        $id = $this->service->createModel->id;

        if(!$id ){
            throw new InputError('参数有误');
            return;
        }
        $enter = DB::table('settled_in')
            ->where('id','=',$id)
            ->where('is_delete','=','0')
            ->first();
        $weburl = substr($enter->web_url,0,4);
        if($weburl != null && $weburl != 'http'){
            throw new InputError('网页链接格式有误');
            return;
        }
    }
}